-# Hide header in map view if mobile
%header.header
  .header-wrapper
    .header-right.header-padding.visible-tablet
      = link_to t("homepage.index.post_new_listing"), new_listing_path, :class => "new-listing-link", :id => "new-listing-link"

    .header-right.visible-tablet
      #header-menu-desktop-anchor.header-menu-container.toggle.hidden{data: {toggle: '#header-menu-toggle-menu', 'toggle-position' => 'absolute'}}

    - if logged_in
      .header-right
        = render :partial => "layouts/header_anchors", locals: {avatar_url: avatar_url, current_user_name: current_user_name, icons: icons}
        = render :partial => "layouts/header_user_menu", locals: {unread_count: unread_count, inbox_path: inbox_path, profile_path: profile_path, manage_listings_path: manage_listings_path, settings_path: settings_path, logout_path: logout_path, icons: icons}

      = render :partial => "layouts/header_right_visible_tablet", locals: {unread_count: unread_count, inbox_path: inbox_path, icons: icons}

    - if available_locales.size > 1
      .header-right.visible-desktop
        #header-locales-menu.toggle.header-hover{data: {toggle: '#header-locales-toggle-menu', 'toggle-position' => 'absolute'}}
          %span.header-text-link
            = current_locale_name
            = icon_map_tag(icons, "dropdown", ["icon-dropdown"])
        #header-locales-toggle-menu.toggle-menu.header-toggle-menu-language.hidden
          - locale_change_links.each do |locale_change_link|
            %a{href: locale_change_link[:url]}
              = locale_change_link[:title]

    - unless logged_in
      .header-right
        = link_to login_path, class: "header-text-link header-hover", id: "header-login-link" do
          = t("header.login")
      .header-right
        = link_to sign_up_path, class: "header-text-link header-hover" do
          = t("header.signup")

    .header-left.hidden-tablet
      .header-menu-container.toggle.hidden{data: {toggle: '#header-menu-toggle-menu', 'toggle-position' => 'absolute'}}
        #header-menu-mobile-anchor.header-menu-toggle-container.toggle-header-container
          = icon_map_tag(icons, "rows", ["header-menu-icon"])
          %span.visible-tablet-inline
            = t("header.menu")

    = render :partial => "layouts/header_menu", locals: { locale_change_links: locale_change_links, icons: icons}

    -#
      If necessary, the buttons will overlap with the logo. Buttons should be on top, that's
      keep the logo here after buttons
    .header-left.header-logo-container
      = link_to landing_page_path, :class => "header-logo", :id => "header-logo" do
        - if @current_community.logo.present?
          %i.header-square-logo.hidden-tablet
            -# Logo is here, it's a CSS background
        - else
          %span.header-square-logo-text.hidden-tablet
            = @current_community.name(I18n.locale)[0]
        - if @current_community.wide_logo.present?
          %i.header-wide-logo.visible-tablet
            -# Logo is here, it's a CSS background
        - else
          %span.header-wide-logo-text.visible-tablet
            = @current_community.name(I18n.locale)
